<?php

namespace app\admin\model\shopro;

use app\admin\model\Admin;
use app\admin\model\shopro\user\User;
use app\admin\model\shopro\user\User as UserModel;
use app\common\model\MoneyLog;
use app\common\model\ScoreLog;
use think\Model;

class StorePerformance extends Model
{

    // 表名
    protected $name = 'store_performance';
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 追加属性
    protected $append = [
    ];


    public function user()
    {
        return $this->belongsTo(UserModel::class, 'user_id', 'id')->field('id, nickname, avatar, mobile');
    }

    public function admin()
    {
        return $this->belongsTo(Admin::class, 'admin_id', 'id')->field('id, nickname, avatar, mobile');
    }
}
